/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + "_1635214780909_5387";

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  // 关闭post请求egg的限制
  config.security = {
    csrf: {
      enable: false
    }
  };

  config.jwt = {
    secret: "15624631135"
  };

  // 配置数据库
  config.sequelize = {
    dialect: "mysql",
    host: "127.0.0.1",
    port: 3306,
    database: "flower_shop",
    username: "root",
    password: "123456",
    // 设置时区
    timezone: "+08:00"
  };
  // 配置参数校验扩展
  config.valparams = {
    locale: "zh-cn",
    throwError: false
  };
  //配置数据加密 config/config.default.js
  config.crypto = {
    secret: "Z#fOGf$te4^J28l1Z&$#fXCNifv!ZHQnEG"
  };
  return {
    ...config,
    ...userConfig
  };
};
